package com.wanmait.employment.manageController;

import com.github.pagehelper.PageInfo;
import com.wanmait.employment.entity.Log;
import com.wanmait.employment.service.LogService;
import com.wanmait.employment.util.AjaxResult;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;

@RestController()
@RequestMapping("manage/log")
public class LogController {

    @Resource
    private LogService logService;

    @GetMapping("list")
    public AjaxResult list(String name , Integer pageNum, Integer pageSize, @DateTimeFormat(pattern = "yyyy-MM-dd") Date date){
        System.out.println("++++++");
        PageInfo<Log> logPageInfo=logService.findAll(name,pageNum,pageSize,date);
        return AjaxResult.success("success").put("logPageInfo",logPageInfo);
    }
}
